package com.lnsf.entity;

import java.util.Date;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Cacheable
@Entity
@Table(name="Orders")
public class Orders {
	@TableGenerator(
			name = "ordersSeq",
			allocationSize = 1,
			initialValue = 1 ,
			pkColumnName = "Pk_name",
			pkColumnValue = "orders_id",
			valueColumnName = "Pk_value"
		)
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE , generator = "ordersSeq")
	private Integer id;
	
	@ManyToOne(targetEntity=User.class)
	@JoinColumn(name="user_id")
	private User user;
	
	@OneToOne
	private Goods goods;
	
	@Temporal(TemporalType.DATE)
	private Date createTime;
	
	
	private String describle;
	
	
	

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Goods getGoods() {
		return goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getDescrible() {
		return describle;
	}

	public void setDescrible(String describle) {
		this.describle = describle;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
}
